<template>
	<view :style="themeColor">
		<view class="page">
			<view
				class="flex flex-direction flex-wrap align-stretch justify-center benben-position-layout flex evaluates_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-stretch justify-between evaluates_fd0_0'>
					<view class='flex flex-wrap align-center evaluates_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  evaluates_fd0_0_c0_c0'>&#xe794;</text>
					</view>
					<view class='flex flex-wrap align-center'>
						<text class='evaluates_fd0_0_c1_c0'>全部评价</text>
					</view>
					<view class='flex align-center justify-end evaluates_fd0_0_c2'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---全部评论flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout evaluates_flex_1">
				<view class='flex flex-direction flex-wrap align-stretch evaluates_fd1_0'>
					<benben-select-diy ref="showSelectPopup1667036742877" class-name='flex flex-wrap align-center flex'
						:items.sync="dataTbas" v-model="evaluateID" :label.sync="evaluateLable" @change="getListFunc()"
						default-type="type" default-label="name" :allow-cancel='true' type="radio" :disabled='false'
						v-if="dataTbas.length!='0'">
						<template v-for='(item,key0) in dataTbas'>
							<view v-if="item.isSelected"
								class='flex align-center justify-center flex evaluates_fd1_0_c0_c0' :key="key0"
								@tap="$refs.showSelectPopup1667036742877.tapHandle(key0)">
								<text class='evaluates_fd1_0_c0_c0_c0'>{{item.name}}</text>
								<text class='evaluates_fd1_0_c0_c0_c1'>{{item.nums}}</text>
							</view>
							<view v-else class='flex align-center justify-center flex evaluates_fd1_0_c0_c1' :key="key0"
								@tap="$refs.showSelectPopup1667036742877.tapHandle(key0)">
								<text class='evaluates_fd1_0_c0_c1_c0'>{{item.name}}</text>
								<text class='evaluates_fd1_0_c0_c1_c1'>{{item.nums}}</text>
							</view>
						</template>
					</benben-select-diy>
				</view>
				<view class='flex flex-wrap align-center evaluates_fd1_1'>
				</view>
				<template v-for='(item,key0) in dataList'>
					<view class='flex flex-direction flex-wrap align-stretch evaluates_fd1_2' @tap.stop="handleJumpDiy"
						data-type="navigateTo" :data-url="`/?gc_id=${item.aid}`" :key='key0'>
						<view class='flex flex-wrap align-start flex-sub evaluates_fd1_2_c0'>
							<image class='evaluates_fd1_2_c0_c0' mode="aspectFill"
								:src="item.head_img || STATIC_URL + '219.png'"></image>
							<view class='flex flex-direction flex-wrap align-stretch flex-sub'>
								<view class='flex flex-wrap align-center justify-between evaluates_fd1_2_c0_c1_c0'>
									<text class='evaluates_fd1_2_c0_c1_c0_c0'>{{item.user_nickname}}</text>
									<text
										class='evaluates_fd1_2_c0_c1_c0_c1'>{{(item.create_time||"").slice(0,10)}}</text>
								</view>
								<view class='flex flex-wrap align-center'>
									<template v-for="starNum in [1,2,3,4,5]">
										<image v-if="item.stars >= starNum" :key="starNum"
											class='evaluates_star1fd1_2_c0_c1_c1' mode="aspectFit"
											:src='STATIC_URL+"611.png"'></image>
										<image v-else :key="starNum" class='evaluates_star1fd1_2_c0_c1_c1'
											mode="aspectFit" :src='STATIC_URL+"240.png"'></image>
									</template>
								</view>
							</view>
						</view>
						<text class='evaluates_fd1_2_c1'>{{item.content}}</text>
						<view class='flex flex-wrap align-center evaluates_fd1_2_c2'>
							<template v-for='(child,key1) in item.images'>
								<view class='flex flex-wrap align-center evaluates_fd1_2_c2_c0' :key='key1'>
									<image class='evaluates_fd1_2_c2_c0_c0' mode="aspectFill" :src='child'
										@tap.stop="multiImagePreview(child,item.thumb,'')"></image>
								</view>
							</template>

						</view>
						<view v-if="item.sku_name" style="margin-top: 24rpx;color:#999;">{{item.sku_name}}</view>
						<view v-if="false" class='flex flex-wrap align-center evaluates_fd1_2_c3'>
							<text class='evaluates_fd1_2_c3_c0'>{{item.key_name}}</text>
							<text class='evaluates_fd1_2_c3_c1'>{{item.reply_num}}</text>
							<image class='evaluates_fd1_2_c3_c2' mode="aspectFit" :src='STATIC_URL+"241.png"'></image>
							<view class='flex align-end justify-end evaluates_fd1_2_c3_c3'
								@tap.stop="dianzanFunc(item)">
								<text class='evaluates_fd1_2_c3_c3_c0'>{{item.likes_num}}</text>
								<image class='evaluates_fd1_2_c3_c3_c1' mode="aspectFit" :src='STATIC_URL+"171.png"'
									v-if="item.is_likes=='0'"></image>
								<image class='evaluates_fd1_2_c3_c3_c1' mode="aspectFit" :src='STATIC_URL+"172.png"'
									v-if="item.is_likes=='1'"></image>
							</view>
						</view>
					</view>
				</template>
				<fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
					:listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
			</view>

			<!---全部评论flex布局结束-->


		</view>
	</view>
</template>
<script>
	import pagingList from '@/common/mixin/paging_list.js';
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},
		mixins: [pagingList],

		data() {
			return {
				"minixPagingListsApi": "",
				"pageingListApiMethod": "",
				"allowOnloadGetList": false,
				"evaluateID": "0",
				"evaluateLable": "",
				"evaluate": [],
				"dataList": [],
				"dataTbas": [],
				"id": "346"
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},
			isLogin() {
				return this.$store.state.token == '' ? false : true;
			},
			userInfo: {
				get() {
					return this.$store.state.userInfo
				},
				set() {
					this.$store.commit('updateUserInfo', value)
				},
			}
		},
		watch: {},
		onLoad(options) {
			let {
				id
			} = options
			if (id !== undefined) this.id = id
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.getTypeFunc()
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {
			this.getListFunc()
		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//点赞
			async dianzanFunc(item) {

				if (this.isLogin == true) {
					let data641ae9cf8abed = await this.$api.post(global.apiUrls.post641ae9cf8abed, {
						gc_id: item.aid,
					})
					if (data641ae9cf8abed.data.code != 1) {
						this.$message.info(data641ae9cf8abed.data.msg)
						return
					}
					//手动更新
					if (item.is_likes) {
						this.$set(item, 'likes_num', --item.likes_num)
					} else {
						this.$set(item, 'likes_num', ++item.likes_num)
					}
					this.$set(item, 'is_likes', !item.is_likes)
				} else {
					this.$message.info("请先登录")
					this.toLoginDiy();
				}
			},
			//商品评论-获取评论列表头部tab
			async getTypeFunc() {
				//请求方法
				//数据验证

				let datadataTbas = await this.$api.post(`/${this.apiFix}/6551bb5adad1a`, {
					goods_id: this.id
				});

				if (datadataTbas.data.code != 1) {
					this.$message.info(datadataTbas.data.msg);
					return
				}
				let infodataTbas = datadataTbas.data;
				this.dataTbas = infodataTbas.data
				this.getListFunc()
			},
			//获取评价列表
			getListFunc() {
				this.minixPagingListsApi = `/${this.apiFix}/6551bb793d10e`;
				this.pageingListApiMethod = 'post';
				this.allowOnloadGetList = false;
				this.pagingListPostDataContent = {
					goods_id: this.id,
					user_id: this.userInfo.id,
					type: this.evaluateID
				}
				this.listData = [];
				this.dataList = this.listData;
				this.pagingListToggle();
			},
			pagingListPostData() {
				return this.pagingListPostDataContent
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background-size: 100% auto;
		background-color: #FFFFFF;
	}

	.evaluates_flex_0 {
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-color: #FFFFFF;
		background-size: 100% auto !important;
	}

	.evaluates_fd0_0_c2 {
		padding: 0rpx 0rpx 0rpx 0rpx;
		width: 150rpx;
	}

	.evaluates_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
		line-height: 50rpx;
	}

	.evaluates_fd0_0_c0_c0 {
		font-size: 32rpx;
		color: #333;
	}

	.evaluates_fd0_0_c0 {
		width: 150rpx;
	}

	.evaluates_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.evaluates_flex_1 {
		// padding: 32rpx 32rpx 0rpx 32rpx;
	}

	.evaluates_fd1_2_c3_c3_c1 {
		width: 24rpx;
		height: 26rpx;
	}

	.evaluates_fd1_2_c3_c3_c0 {
		font-size: 22rpx;
		font-weight: 400;
		color: #333;
		line-height: 24rpx;
		margin: 0rpx 8rpx 0rpx 0rpx;
	}

	.evaluates_fd1_2_c3_c3 {
		margin: 0rpx 0rpx 4rpx 0rpx;
	}

	.evaluates_fd1_2_c3_c2 {
		width: 26rpx;
		height: 24rpx;
		margin: 0rpx 48rpx 0rpx 8rpx;
	}

	.evaluates_fd1_2_c3_c1 {
		font-size: 22rpx;
		font-weight: 400;
		color: #000000;
		line-height: 30rpx;
		vertical-align: baseline;
		margin: 0rpx 0rpx 0rpx auto;
	}

	.evaluates_fd1_2_c3_c0 {
		font-size: 24rpx;
		font-weight: 400;
		color: #999999;
		line-height: 33rpx;
	}

	.evaluates_fd1_2_c3 {
		border-bottom: 1px solid #eee;
		margin: 8rpx 32rpx 0rpx 32rpx;
		padding: 0rpx 0rpx 32rpx 0rpx;
	}

	.evaluates_fd1_2_c2_c0_c0 {
		width: 200rpx;
		height: 200rpx;
		border-radius: 16rpx;
	}

	.evaluates_fd1_2_c2_c0 {
		margin: 0rpx 4rpx 24rpx 0rpx;
	}

	.evaluates_fd1_2_c2 {
		margin: 0rpx 0rpx 0rpx 32rpx;
	}

	.evaluates_fd1_2_c1 {
		margin: 0rpx 32rpx 16rpx 32rpx;
		font-size: 26rpx;
		font-weight: 400;
		color: #333333;
	}

	.evaluates_star1fd1_2_c0_c1_c1 {
		height: 18rpx;
		margin: 0rpx 5rpx 0rpx 5rpx;
		width: 18rpx;
	}

	.evaluates_star1fd1_2_c0_c1_c1 {
		width: 18rpx;
		height: 18rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 5rpx 0rpx 5rpx;
	}

	.evaluates_fd1_2_c0_c1_c0_c1 {
		font-size: 24rpx;
		font-weight: 400;
		color: rgba(153, 153, 153, 1);
	}

	.evaluates_fd1_2_c0_c1_c0_c0 {
		font-size: 28rpx;
		font-weight: 400;
		color: rgba(51, 51, 51, 1);
	}

	.evaluates_fd1_2_c0_c1_c0 {
		margin: 0rpx 0rpx 8rpx 0rpx;
	}

	.evaluates_fd1_2_c0_c0 {
		width: 56rpx;
		height: 56rpx;
		border-radius: 28rpx 28rpx 28rpx 28rpx;
		margin: 0rpx 16rpx 0rpx 0rpx;
	}

	.evaluates_fd1_2_c0 {
		margin: 0rpx 32rpx 24rpx 32rpx;
	}

	.evaluates_fd1_2 {
		padding: 32rpx 0rpx 0rpx 0rpx;
		width: 686rpx;
		margin: 24rpx auto;
		background-color: #fff;
		border-radius: 16rpx;
	}

	.evaluates_fd1_1 {
		background: var(--benbenbgColor5);
		background-size: 100% auto !important;
		height: 20rpx;
	}

	.evaluates_fd1_0_c0_c1_c1 {
		font-size: 28rpx;
		font-weight: 400;
		color: var(--benbenFontColor0);
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-align: center;
		line-height: 40rpx;
		margin: 0rpx 0rpx 0rpx 10rpx;
	}

	.evaluates_fd1_0_c0_c1_c0 {
		font-size: 28rpx;
		font-weight: 400;
		color: var(--benbenFontColor0);
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-align: center;
		line-height: 40rpx;
	}

	.evaluates_fd1_0_c0_c1 {
		background: #F8F8F8;
		margin: 12rpx 8rpx 12rpx 8rpx;
		height: 56rpx;
		border-radius: 28rpx 28rpx 28rpx 28rpx;
		padding: 0rpx 25rpx 0rpx 25rpx;
		width: 200rpx;
	}

	.evaluates_fd1_0_c0_c0_c1 {
		font-size: 28rpx;
		font-weight: 400;
		color: #F35D2A;
		line-height: 40rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-align: center;
		margin: 0rpx 0rpx 0rpx 10rpx;
	}

	.evaluates_fd1_0_c0_c0_c0 {
		font-size: 28rpx;
		font-weight: 400;
		color: #F35D2A;
		line-height: 40rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-align: center;
	}

	.evaluates_fd1_0_c0_c0 {
		border: 1rpx solid #F35D2A;
		background: #FFF0ED;
		margin: 12rpx 8rpx 12rpx 8rpx;
		height: 56rpx;
		border-radius: 28rpx 28rpx 28rpx 28rpx;
		padding: 0rpx 25rpx 0rpx 25rpx;
		width: 200rpx;
		color: #F35D2A;
	}

	.evaluates_fd1_0 {
		padding: 32rpx;
	}
</style>